<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>189000503左香菊</title>
        <script>
            //189000503  左香菊
            function myfun(){
                
                /*
                输出三角形
                */
                for ( row = 1 ; row <= i ; row ++ ) {
            	    for ( k = 1 ; k <= i - row ; k ++) {
           		        document.write(' ') ;
            	    }
           	        for ( star = 1 ; star <= row ; star ++ ) {
           		        document.write( '*' + ' ' ) ;
            	    }
           	        document.write( '<br/>' ) ;
                }
                
               /*
           	    输出平行四边形
                */
                for ( row = 1 ; row <= i ; row++ ) {
           	        for ( k = 1 ; k <= i - row ; k ++ ) {
           		        document.write( ' ' ) ;
                	}
           	        for ( star = 1 ; star <= i ; star ++ ) {
           		        document.write ( '*' + ' ' ) ;
           	    }
           	        document.write( '<br/>' ) ;
                }

            var i = window.prompt("请输入行数", "");
            myfun(i);//调用函数
        }

           
        </script>
</head>
<body>
    
</body>
</html>